package top.kaoshanji.p1ch05a;

/**
 * 代码清单-p1ch05a-089页a：return版本的if语句
 * author kaoshanji
 * ^_^
 * create time 2025/3/6 21:46
 */
public class TestWithReturn {

    public static void main(String[] args) {
        System.out.println(test(10, 5));
        System.out.println(test(5, 10));
        System.out.println(test(5, 5));
    }

    static int test(int testval, int target) {
        if (testval > target) {
            return +1;
        }
        if (testval < target) {
            return -1;
        }
        return 0;
    }

}
